package com.lichuang.fruitvarietysm.goods.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lichuang.fruitvarietysm.goods.entity.Goods;
import com.lichuang.fruitvarietysm.goods.mapper.GoodsMapper;
import com.lichuang.fruitvarietysm.goods.service.IGoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lichuang.fruitvarietysm.goods.vo.GoodsCategoryVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 商品表 服务实现类
 * </p>
 *
 * @author shuaihang
 * @since 2019-05-17
 */
@Service
public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements IGoodsService {

    @Autowired
   private GoodsMapper goodsMapper;


    @Override
    public List<Goods> goodsList(Integer parent_id) {
        return goodsMapper.goodsList(parent_id);
    }

    @Override
    public IPage<List<GoodsCategoryVO>> sParentThreeGoods(Page page,
                                                          String attribute_id,
                                                          Integer pid,
                                                          Integer parent_id,
                                                          Integer category_id,
                                                          String sort,
                                                          Integer start_price,
                                                          String end_price) {
        return goodsMapper.sParentThreeGoods(page,attribute_id,pid,parent_id,category_id,sort,start_price,end_price);
    }

    @Override
    public Goods sGoodsDetailsNoSku(Integer goods_id) {
        return goodsMapper.sGoodsDetailsNoSku(goods_id);
    }

    @Override
    public int goodEvaluate(Integer goods_id) {
        return goodsMapper.goodEvaluate(goods_id);
    }


}
